<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        .box {
            width: 200px;
            height: 200px;
            background-color: black;
            margin-left: 100px;
            margin-top: 100px;
        }
    </style>
</head>

<body>
    <div class="box"></div>
    <script>
        var box = document.querySelector('.box');
        box.onclick = function(ev) {
            var ev = event;
            box.offsetWidth;
            box.offsetHeight;
            box.offsetLeft;
            box.offsetTop;
            ev.clientX;
            ev.clientY;
            // 鼠标与元素左边距的宽度
            var x = ev.clientX - box.offsetLeft;
            var y = ev.clientY - box.offsetTop
            console.log(x, y);
            box.onmousmove = function(ev) {
                var =
            }


        }
    </script>
</body>

</html>